<?php
/* use Zend\Mvc\Router\Http\Regex;
$route = Regex::factory(array(
		'regex' => '/index/(?<id>[a-zA-Z0-9_-]+)(\.(?<format>(json|html|xml|rss)))?',
		'defaults' => array(
				'controller' => 'ProductType\Controller\IndexController',
				'action'     => 'footer',
				'format'     => 'html',
		),
		'spec' => '/index/%id%.%format%',
)); */
//$routePlugins = new Zend\Mvc\Router\RoutePluginManager();
return array(
    'router' => array(
        'routes' => array(
 		     'producttype' => array(
        				'type' => 'Zend\Mvc\Router\Http\Literal',
        				'options' => array(
        						'route'    => '/producttype',
        						'defaults' => array(        								
        								'controller' => 'ProductType\Controller\Index',
        								'action'     => 'index',
        						),
        				),
        				'may_terminate' => true,
        				'child_routes' => array(
        						'default' => array(
        								'type'    => 'Segment',
        								'options' => array(
        										'route'    => '[/:action][/:id]',
        										'constraints' => array(
        												'action'=> '[a-zA-Z][a-zA-Z0-9_-]*',
        												'id' => '[0-9,]+',
        												
        										),
        										'defaults' => array(
        												'controller'    => 'ProductType\Controller\Index',
        												'action'        => 'index',
        										),
        								),
        								
        						),
        						
        						
        		        ),
  	
        		),
        		
        		'producttype_edit' => array(
        				'type' => 'Regex',
        				'options' => array(
        						'regex' => '/producttype/edit/(?<id>[\/a-zA-Z0-9_-]+)(\.(?<format>(json|html|xml|rss)))?',
        						'spec' => '/producttype/edit/%id%.%format%',
        						'defaults' => array(
        								'controller' => 'ProductType\Controller\Index',
        								'action'     => 'edit',
        								'format'     => 'html',
        						),
        				),
        		),        		
        		
        		'addtype' => array(
        				'type' => 'Literal',
        				'options' => array(
        						'route'    => '/producttype/add.html',
        						'defaults' => array(
        								'controller'    => 'ProductType\Controller\Index',
        								'action'        => 'add',
        						),
        				),
        		),
        ),
    ),
    'service_manager' => array(
        'factories' => array(
            'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory',
        ),
    ),
    'translator' => array(
        'locale' => 'en_US',
        'translation_file_patterns' => array(
            array(
                'type'     => 'gettext',
                'base_dir' => __DIR__ . '/../language',
                'pattern'  => '%s.mo',
            ),
        ),
    ),
    'controllers' => array(
        'invokables' => array(
            'ProductType\Controller\Index' => 'ProductType\Controller\IndexController',
        ),
    ),
    'view_manager' => array(
        'display_not_found_reason' => true,
        'display_exceptions'       => true,
        'doctype'                  => 'HTML5',
        'not_found_template'       => 'error/404',
        'exception_template'       => 'error/index',
        'template_map' => array(
            'layout/backend'          => TEMPALATE_PATH . '/backend/index.phtml',
            'error/404'               => __DIR__ . '/../view/error/404.phtml',
            'error/index'             => __DIR__ . '/../view/error/index.phtml',
        		'layout/menu'         => TEMPALATE_PATH . '/backend/menu.phtml',
        		'layout/breadcrumbspro'  => TEMPALATE_PATH . '/backend/breadcrumbs.phtml',
        		'layout/submenupro'      => TEMPALATE_PATH . '/backend/submenu.phtml',
        		'layout/top'          => TEMPALATE_PATH . '/backend/top.phtml',
        		'layout/left'         => TEMPALATE_PATH . '/backend/left.phtml',
        		'layout/footer'       => TEMPALATE_PATH . '/backend/footer.phtml',
        		'layout/paginator'    => TEMPALATE_PATH . '/backend/paginator.phtml',
        ),
        'template_path_stack' => array(
            __DIR__ . '/../view',
        ),
    ),
);
